﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="NewsManage.aspx.cs" Inherits="HCFramework.News.NewsManage" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="groupHeader">
        News management
    </div>
    <asp:Panel ID="PanelGrid" runat="server">
        <telerik:RadGrid ID="RadGridMain" runat="server" Skin="Office2007" AutoGenerateColumns="False"
            OnItemCommand="RadGridMain_ItemCommand" OnPreRender="RadGridMain_PreRender" AllowFilteringByColumn="True"
            AllowPaging="True" AllowSorting="True" GridLines="None" AllowMultiRowSelection="True">
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
            <MasterTableView CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Thêm mới"
                NoMasterRecordsText="No records.">
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <CommandItemSettings AddNewRecordText="Thêm mới" />
                <Columns>
                    <telerik:GridClientSelectColumn UniqueName="column">
                    </telerik:GridClientSelectColumn>
                    <telerik:GridBoundColumn DataField="NewsID" UniqueName="NewsID" Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Title" HeaderText="Title" UniqueName="Title">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="DisplayInLang" HeaderText="Language" UniqueName="DisplayInLang">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Category" UniqueName="Name">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Username" HeaderText="Username" UniqueName="Username">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="DateCreated" HeaderText="DateCreated" UniqueName="DateCreated">
                    </telerik:GridBoundColumn>
                    <telerik:GridHyperLinkColumn DataNavigateUrlFields="NewsID" DataNavigateUrlFormatString="~/News/Detail.aspx?NewsID={0}"
                        Text="View" Target="_blank">
                    </telerik:GridHyperLinkColumn>
                    <telerik:GridButtonColumn CommandName="Sua" Text="Edit" UniqueName="Sua">
                    </telerik:GridButtonColumn>
                    <telerik:GridButtonColumn CommandName="Xoa" Text="Delete" UniqueName="Xoa" ConfirmText="Are you sure to delete this record?">
                    </telerik:GridButtonColumn>
                </Columns>
                <CommandItemTemplate>
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/Image/add.gif" />
                    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Them" AccessKey="n"
                        TabIndex="1">Insert</asp:LinkButton>
                </CommandItemTemplate>
            </MasterTableView>
        </telerik:RadGrid>
    </asp:Panel>
    <asp:Panel ID="PanelAddAndEdit" runat="server">
        <table>
            <tr>
                <td style="font-weight: bold">
                    Language:
                </td>
                <td>
                    <asp:DropDownList ID="cboLang" runat="server">
                        <asp:ListItem Value="VN" Text="Vietnam"></asp:ListItem>
                        <asp:ListItem Value="EN" Text="English"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td style="font-weight: bold">
                    Category:
                </td>
                <td>
                    <asp:DropDownList ID="cboCategory" DataTextField="Name" DataValueField="ID"
                        runat="server">
                    </asp:DropDownList>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td style="font-weight: bold">
                    Title:
                </td>
                <td>
                    <asp:TextBox ID="txtTitle" runat="server" Width="500px"></asp:TextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td style="font-weight: bold">
                    Summary:
                </td>
                <td>
                    <asp:TextBox ID="txtSummary" runat="server" Width="100%" Height="100px" TextMode="MultiLine"></asp:TextBox>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td style="font-weight: bold">
                    Content:
                </td>
                <td>
                    <telerik:RadEditor AllowScripts="true" ID="RadEditor1" runat="server" Width="100%">
                        <Content>        
        
                        </Content>
                        <ImageManager DeletePaths="~/Image/Upload" UploadPaths="~/Image/Upload" ViewPaths="~/Image/Upload"
                            MaxUploadFileSize="50000000" />
                        <DocumentManager DeletePaths="~/File/Document" UploadPaths="~/File/Document" ViewPaths="~/File/Document"
                            MaxUploadFileSize="2004800" SearchPatterns="*.*" />
                        <FlashManager DeletePaths="~/File/Flash" MaxUploadFileSize="50000000" UploadPaths="~/File/Flash"
                            ViewPaths="~/File/Flash" />
                        <MediaManager DeletePaths="~/File/Media" MaxUploadFileSize="100000000" UploadPaths="~/File/Media"
                            ViewPaths="~/File/Media" />
                        <TemplateManager DeletePaths="~/File/TemplateHtml" UploadPaths="~/File/TemplateHtml"
                            ViewPaths="~/File/TemplateHtml" />
                    </telerik:RadEditor>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Button ID="ButtonAdd" runat="server" Text="Insert" OnClick="ButtonAdd_Click" />
                    <asp:Button ID="ButtonUpdate" runat="server" Text="Update" OnClick="ButtonUpdate_Click" />
                    <asp:Button ID="ButtonCancel" runat="server" Text="Cancel" OnClick="ButtonCancel_Click"
                        CausesValidation="False" />
                </td>
                <td>
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Label ID="LabelID" runat="server" Text="" Visible="False"></asp:Label>
</asp:Content>
